<!DOCTYPE html>
<html lang="en" ng-app="app" ng-controller="myApp" data-title="经销商推荐的门店经理">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>{{title}}</title>
    <link rel="stylesheet" href="./static/css/base.css">
    <link rel="stylesheet" href="./static/css/nominate.css">
</head>

<body ng-cloak class="ng-cloak">
<div class="title">
        <span ng-click="pingj()">
            < </span>
    经销商推荐的门店经理
</div>
<div class="main">
    <div class="content">
        <div class="info">
            <div class="infoleft">
                <img ng-src="{{info.avatar}}" alt="">
                <span>{{info.position?info.position:'销售经理'}}</span>
            </div>
            <div class="inforight">
                <p>{{addres}}</p>
                <div>
                    <span>{{info.name}}</span>=========
                    <span>{{info.name}}</span>
                </div>
                <div>
                    <span>144km</span>
                    <span>打电话</span>
                </div>
            </div>
        </div>
        <div class="english">
            <p>以服务
                <span class="englishName">{{126}}</span>顾客</p>
            <div class="engD">
                <span class="eng">综合评分</span>
                <span class="starBig" ng-class="{starBigcur:index<=score.totalScore-1}"
                      ng-repeat="(index,item) in star">&#9733;</span>
            </div>
            <div class="score">
                <span class="scoreEng">服务态度</span>
                <span class="scoreStar" ng-class="{scoreStarcur:index<=score.attitude-1}"
                      ng-repeat="(index,item) in star">&#9733;</span>
            </div>
            <div class="score">
                <span class="scoreEng">专业知识</span>
                <span class="scoreStar" ng-class="{scoreStarcur:index<=score.profession-1}"
                      ng-repeat="(index,item) in star">&#9733;</span>
            </div>
            <div class="score">
                <span class="scoreEng">反馈及时度</span>
                <span class="scoreStar" ng-class="{scoreStarcur:index<=score.response-1}"
                      ng-repeat="(index,item) in star">&#9733;</span>
            </div>
        </div>
        <div class="qrcode"><img ng-src="{{info.qrCode}}" alt=""></div>
    </div>

</div>
<div class="footer" ng-if="!isEnd">
    <div class="other">
        <p>其他门店经理</p>
        <div class="icon">
            <div class="qr" ng-if="indexinfo!=index" ng-repeat="(index,item) in infoAll" ng-click="byClick(item.id)">
                <span><img ng-src="{{item.avatar}}" alt=""></span>
            </div>
        </div>
    </div>

</div>
<!-- js -->
<script src="./static/js/lib/pxRem.js"></script>
<script src="./static/js/lib/jquery.min.js"></script>
<script src="./static/js/lib/angular.js"></script>
<script src="./static/js/lib/vconsole.min.js"></script>
<script src="./static//js/server.js"></script>
<script>
    var app = angular.module("app", ['myserver']);
    app.controller('myApp', ['$scope', '$http', '$rootScope', '$q', '$window', 'axios','wxAlert', function ($scope, $http, $rootScope,
                                                                                                  $q, $window, axios,wxAlert) {
        $scope.id = $window.location.href.split('wxDepartmentId=')[1] ? '10000187' : '10000187'
        $scope.isEnd = 0

        /*title*/
        $scope.title = '推荐经理';
        $scope.index = 1;
        //全部门店经理信息
        $scope.infoAll = [];
        //随机出来的门店经理信息
        $scope.info = {};
        //门店地址
        $scope.addres = '南京门店';
        //星星数量
        $scope.star = [0, 1, 2, 3, 4];
        //评分
        $scope.score = {};

        /*门店经理数据*/

        axios.getByShop($scope.id).then(function (data) {
            console.log(data,'所有数据');

            $scope.indexinfo = Math.floor(Math.random() * data.data.length)
            $scope.infoAll = data.data
            $scope.info = data.data[$scope.indexinfo]
            $scope.score = $scope.info.score

        })


        /*点击门店经理头像跳转*/
        $scope.byClick = function (SaleId) {
            axios.BySaleId(SaleId).then(function (res) {
                console.log(res,'resss');
                $scope.isEnd = 1
                $scope.info = res.data
                $scope.score = $scope.info.score
            })
        }

        /*暂时跳转评价页面*/
        $scope.pingj = function (){
            $window.location.href =  './kps.html'
        }


    }])
</script>
</body>

</html>